package com.gjr.demo.EasyExcel.entity;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * EasyExcel 监听类
 */
public class ExcelListener extends AnalysisEventListener<DemoData> {

    /**
     * 一行一行读取excel内容
     *
     * @param data 存储每行的数据
     */
    @Override
    public void invoke(DemoData data, AnalysisContext analysisContext) {
        System.out.println("****" + data);
    }

    /**
     * 读取表头内容
     *
     * @param headMap 表头数据
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头：" + headMap);
    }

    /**
     * 读取完成之后
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
